/**
 * Created by Silence on 2016/12/15.
 */
$(document).ready(function () {
    var $imgs = $('.banner-bg');
    var $banner_words = $('.banner-word');
    var $season=$('.ico span');
    var banner_th = 0;
    var banner_zindex = -990;

    function changeImg() {
        if (banner_th >= $imgs.length) {
            banner_th = 0;
        }
        $imgs.eq(banner_th).css({'z-index': banner_zindex++, 'opacity': '0'}).animate({'opacity': '1'}, 4000);
        $banner_words.eq(banner_th).css({'z-index': banner_zindex++, 'opacity': '0'}).animate({'opacity': '1'}, 1000);
        $season.css({'font-size':'1vw'});
        $season.eq(banner_th++).css({'font-size':'3vw'});
    }
    changeImg();
    var timemer = setInterval(changeImg, 6000);

    $season.click(function () {
       banner_th=$(this).index();
        changeImg();
        clearInterval(timemer);
        timemer = setInterval(changeImg, 6000);
    });

    // $("#footer").mouseover(function () {
    //     footerAppear();
    // });
    // $("#footer").mouseout(function () {
    //     footerHidden();
    // });
    /**
     * 滚动条滚动触发事件
     */
    var scrollTop;
    $(window).scroll(function () {
        scrollTop = $(document).scrollTop();
        changeNav(scrollTop);
        changeFooter(scrollTop);
    });
});